package com.example.hl.gobang;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.hl.gobang.activity.OnlineActivity;
import com.example.hl.gobang.activity.PlayActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btn_local;
    private Button btn_online;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        btn_local = findViewById(R.id.btn_local);
        btn_online = findViewById(R.id.btn_online);

        btn_local.setOnClickListener(this);
        btn_online.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {

        switch (view.getId()){
            case R.id.btn_local:
                Intent intent=new Intent(this,PlayActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_online:
                Intent intent1=new Intent(this,OnlineActivity.class);
                startActivity(intent1);
                break;
        }

    }
}
